$(document).ready(function() {
	
	
	$("#btnguardarUsuario").click(function() {
	  insertarUsuario();	
	});
	
	$("#idAnimacion").ready(function(){
		cargarAnimacion();
	});
});




function insertarUsuario() {
	var usuario=$('#user').val();
	var password=$('#pass').val();
	var nombre =$('#nombre').val();
	var apellidoP=$('#apPaterno').val();
	var apellidoM=$('#apMaterno').val();
	var fechaNacimiento=$('#fechaNacimiento').val();
	var email=$('#email').val();
	
	var rol=$('#rol').data("kendoDropDownList");
	var genero=$('#genero').data("kendoDropDownList");
	rol = rol.value();
	genero = genero.value();
	$.ajax({
		type :"POST",
		url  :"../../LdapSocioServlet",
		data :{
			operacion:1,
			user   : usuario,
			pass   : password,
			pass2  : password,
			nombre : nombre,
			apPaterno: apellidoP,
			apMaterno: apellidoM,
			fechaNacimiento: fechaNacimiento,
			email:email,
			rol:rol,
			genero:genero
		}
	}).done(function(msg){
		$(location).attr('href','../../');
	});
}


function cargarAnimacion(){

		
	
	var svgData = { 
			"idLine" :
			{ 
				"strokepath" :
				[ 
					{   "path": "m46.2691,332.89554c-9.65673,-3.62033 -7.17397,-15.01047 -7.66534,-23.1124c-0.11193,-31.4982 -0.03005,-62.99933 -0.05428,-94.49603c17.25576,-0.25854 34.50526,-0.61729 51.76389,-0.57024c-0.01819,36.174 0.47034,72.35701 -0.11832,108.52321c-0.45722,9.69806 -11.25764,10.93887 -18.81079,10.00223c-8.37449,0.00296 -16.74677,-0.12582 -25.11515,-0.34677zm-24.87531,-94.27267c-5.46374,-0.58841 -9.98805,-14.3145 -3.5688,-14.27925c5.05158,-0.06682 10.10555,-0.13078 15.15751,-0.19775c0.81567,6.66585 -1.29461,16.16182 -10.02679,14.80104l-1.56192,-0.32404l0,0zm80.88498,-0.00616c-5.6554,-0.70847 -8.7121,-12.51685 -4.59108,-14.26088c5.39681,-0.0688 10.80035,-0.14151 16.20031,-0.20996c0.81583,6.6689 -1.30043,16.16939 -10.03619,14.79939l-1.57304,-0.32855c0,0 0,0 0,0zm-87.17311,-45.89473c0.44514,-11.02849 -0.87996,-22.2897 1.37006,-33.14484c3.29314,-8.45117 11.28237,-16.06296 20.52121,-16.77008c19.12066,0.1642 38.29251,-0.8152 57.37024,0.44098c11.37643,2.51628 20.455,13.78812 19.3728,25.65457c0.26027,17.63084 0.12691,35.26617 0.19655,52.89972c-6.01276,0.07645 -12.01919,0.15381 -18.02577,0.23c0,-15.8701 0,-31.74019 0,-47.60864c-3.52326,-4.13583 -6.52533,1.42032 -5.30917,4.95422c-0.01526,10.70615 -0.0304,21.41385 -0.04537,32.12004c-17.40763,0 -34.81487,0 -52.21913,0c-0.14242,-12.40466 -0.2849,-24.80783 -0.43073,-37.21255c-3.41074,-3.91534 -5.81218,1.44763 -4.72696,4.70296c-0.0575,14.2718 -0.11803,28.54262 -0.1727,42.81398c-6.00977,0.07645 -12.02869,0.15381 -18.04107,0.23c0.04535,-9.76802 0.09374,-19.53922 0.14003,-29.31035zm45.70261,-57.46169c-9.26014,-1.67851 -16.4191,-10.31213 -16.64063,-19.71666c13.39331,0 26.79175,0 40.18509,0c0.47258,12.24042 -11.73154,21.95215 -23.54446,19.71666zm-20.76093,-27.44427c2.28039,-2.29156 4.23861,-5.36298 7.91088,-4.29404c12.13416,0 24.25993,0 36.39451,0c-0.39158,2.6441 0.73933,6.81496 -0.52503,8.58496c-16.01267,0 -32.02764,0 -48.04644,0c1.42472,-1.43068 2.84416,-2.86005 4.26609,-4.29092zm15.30285,-7.59532c-3.74096,-0.04829 -7.48909,-0.09874 -11.23721,-0.14891c0.38856,-2.63953 -0.74302,-6.80435 0.52211,-8.5698c13.23789,0 26.47588,0 39.71764,0c-0.39158,2.6427 0.73933,6.81206 -0.52503,8.58497c-9.49306,-0.06079 -18.98044,0.36803 -28.4775,0.13374zm19.98781,232.92311c-5.30348,-1.82788 -9.21518,-7.40372 -8.17171,-13.06186c-0.18761,-26.91809 0.24869,-53.85492 -0.50345,-80.76102c-6.09998,-6.83502 -4.31124,9.73154 -4.54731,13.51627c-0.32799,24.24982 0.5336,48.56329 -0.64011,72.77689c-0.83401,5.53595 -12.09807,8.44632 -1.9226,7.44421c5.26122,0.06726 10.53042,0.29803 15.78519,0.08551z",
						"duration": 2500
					},	
				],  
				"dimensions" : { "width": 125, "height":410 }
			}
		};
	
	$('#idLine').lazylinepainter({
		'svgData' : svgData,
		'strokeWidth':2,  
		'strokeColor':'#190707',
		'onComplete' : function(){
			$(this).animate({'marginTop':0},500);
			}	
	 }
    ); 

    // Paint your Lazy Line, that easy!
    $('#idLine').lazylinepainter('paint');
	
}

